const express = require("express");
const app = express();
const axios = require("axios");
const md5 = require("md5");
const serverKey = "d7434b6fcff943929c3a884142358139";
const apiUrl = "http://112.14.19.189:8080";

app.post("/api/*", (req, res) => {
  console.log(req);

  axios.post(`${apiUrl}`);

  return res.send("Hello World!");
});

app.use(express.static("dist"));
app.listen(8060, () => console.log("Example app listening on port 8060!"));

function objKeySort(obj) {
  //排序的函数
  var newkey = Object.keys(obj).sort(); //先用Object内置类的keys方法获取要排序对象的属性名，再利用Array原型上的sort方法对获取的属性名进行排序，newkey是一个数组
  var newObj = {}; //创建一个新的对象，用于存放排好序的键值对
  for (var i = 0; i < newkey.length; i++) {
    //遍历newkey数组
    newObj[newkey[i]] = obj[newkey[i]]; //向新创建的对象中按照排好的顺序依次增加键值对
  }
  return newObj; //返回排好序的新对象
}
